package com.ruoyi.project.business.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.business.mapper.BusinessHarvestMapper;
import com.ruoyi.project.business.domain.BusinessHarvest;
import com.ruoyi.project.business.service.IBusinessHarvestService;

/**
 * 收成Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-10-22
 */
@Service
public class BusinessHarvestServiceImpl implements IBusinessHarvestService 
{
    @Autowired
    private BusinessHarvestMapper businessHarvestMapper;

    /**
     * 查询收成
     * 
     * @param id 收成ID
     * @return 收成
     */
    @Override
    public BusinessHarvest selectBusinessHarvestById(Long id)
    {
        return businessHarvestMapper.selectBusinessHarvestById(id);
    }

    /**
     * 查询收成列表
     * 
     * @param businessHarvest 收成
     * @return 收成
     */
    @Override
    public List<BusinessHarvest> selectBusinessHarvestList(BusinessHarvest businessHarvest)
    {
        return businessHarvestMapper.selectBusinessHarvestList(businessHarvest);
    }

    /**
     * 新增收成
     * 
     * @param businessHarvest 收成
     * @return 结果
     */
    @Override
    public int insertBusinessHarvest(BusinessHarvest businessHarvest)
    {
        businessHarvest.setCreateTime(DateUtils.getNowDate());
        return businessHarvestMapper.insertBusinessHarvest(businessHarvest);
    }

    /**
     * 修改收成
     * 
     * @param businessHarvest 收成
     * @return 结果
     */
    @Override
    public int updateBusinessHarvest(BusinessHarvest businessHarvest)
    {
        businessHarvest.setUpdateTime(DateUtils.getNowDate());
        return businessHarvestMapper.updateBusinessHarvest(businessHarvest);
    }

    /**
     * 批量删除收成
     * 
     * @param ids 需要删除的收成ID
     * @return 结果
     */
    @Override
    public int deleteBusinessHarvestByIds(Long[] ids)
    {
        return businessHarvestMapper.deleteBusinessHarvestByIds(ids);
    }

    /**
     * 删除收成信息
     * 
     * @param id 收成ID
     * @return 结果
     */
    @Override
    public int deleteBusinessHarvestById(Long id)
    {
        return businessHarvestMapper.deleteBusinessHarvestById(id);
    }

    /**
     *
     * @param serviceid
     * @return
     */
    @Override
    public BusinessHarvest getinfobyservice(Long serviceOrderId) {
        return businessHarvestMapper.getinfobyservice(serviceOrderId);
    }
}
